from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Edge()
try:
    driver.get("http://121.43.169.97:8848/pageA.html")

    # 等待 id="userA" 的元素出现
    element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "userA"))
    )
    element.send_keys("admin")

finally:
    driver.quit()